const routes = [
  // 登录模块
  {
    path: '/passport',
    name: 'Passport',
    component: () => import('@/pages/passport/Passport.vue'),
    meta: { title: '通行证', hidden: true },
    children: [
      {
        path: '/passport/login',
        name: 'Login',
        component: () => import('@/pages/passport/Login.vue'),
        meta: { title: '登录', hidden: true }
      },
      {
        path: '/passport/register',
        name: 'Register',
        component: () => import('@/pages/passport/Register.vue'),
        meta: { title: '注册', hidden: true }
      },
      {
        path: '/passport/findPwd',
        name: 'FindPassword',
        component: () => import('@/pages/passport/FindPwd.vue'),
        meta: { title: '找回密码', hidden: true }
      }
    ]
  },

  // 根路由
  {
    path: '/',
    name: 'Root',
    component: () => import('@/layout/index.vue'),
    // redirect: '/index',
    meta: { title: '首页', hidden: true },
    // children: [
    //   {
    //     path: 'index',
    //     name: 'Index',
    //     component: () => import('@/layout/index.vue'),
    //     meta: { title: '首页', icon: 'HomeFilled' }
    //   }
    // ]
  },

  // 店铺管理模块
  {
    path: '/merchant',
    name: 'Merchant',
    component: () => import('@/layout/index.vue'),
    meta: { title: '店铺管理', icon: 'Shop' },
    children: [
      {
        path: '/merchant/shopper',
        name: 'MerchantShopper',
        component: () => import('@/pages/merchant/Merchant.vue'),
        meta: { title: '店家管理' }
      },
      {
        path: '/merchant/attr',
        name: 'MerchantAttr',
        component: () => import('@/pages/merchant/Attr.vue'),
        meta: { title: '属性管理' }
      },
      {
        path: '/merchant/spu',
        name: 'MerchantSpu',
        component: () => import('@/pages/merchant/Spu.vue'),
        meta: { title: 'SPU管理' }
      }
    ]
  },

  // 平台管理模块
  {
    path: '/platform',
    name: 'Platform',
    component: () => import('@/layout/index.vue'),
    meta: { title: '平台管理', icon: 'Platform' },
    children: [
      {
        path: '/platform/category',
        name: 'PlatformCategory',
        component: () => import('@/pages/platform/Category.vue'),
        meta: { title: '分类管理' }
      },
      {
        path: '/platform/auth',
        name: 'PlatformAuth',
        component: () => import('@/pages/platform/Auth.vue'),
        meta: { title: "用户管理" }
      }

    ]
  },

  // 404页面
  {
    path: '/:pathMatch(.*)*',
    name: 'NotFound',
    component: () => import('@/pages/404.vue'),
    meta: { title: '页面不存在', hidden: true }
  }
];

export default routes;  